﻿
namespace Indeco.G24.Windows.Forms
{
	/// <summary>
	/// This is the abstract edit form for the <see cref="Entities.CauHinhHeThong"/> entity.
	/// </summary>
	/// <remarks>This class is overwritten by .netTiers at each generation.</remarks>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class CauHinhHeThongEditControlBase : System.Windows.Forms.UserControl
	{
		#region Fields
		
		//private System.Windows.Forms.TableLayoutPanel uxTableLayoutPanel;
		/// <summary>
		/// The ErrorProvider for the Entity;
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxErrorProvider;
		
		/// <summary>
		/// The BindingSource for the entity.
		///</summary>
		protected System.Windows.Forms.BindingSource uxBindingSource;
						
		
		/// <summary>
		/// TextBox for the IDCauHinhHeThong property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxIDCauHinhHeThong;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDCauHinhHeThong property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDCauHinhHeThongLabel;
		
		/// <summary>
		/// TextBox for the Ten property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxTen;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Ten property.
		/// </summary>
		protected System.Windows.Forms.Label uxTenLabel;
		
		/// <summary>
		/// TextBox for the GiaTri property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxGiaTri;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the GiaTri property.
		/// </summary>
		protected System.Windows.Forms.Label uxGiaTriLabel;
		
		/// <summary>
		/// TextBox for the MoTa property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxMoTa;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the MoTa property.
		/// </summary>
		protected System.Windows.Forms.Label uxMoTaLabel;
		#endregion
		
		#region Main entity
		private Entities.CauHinhHeThong _CauHinhHeThong;
		/// <summary>
		/// Gets or sets the <see cref="Entities.CauHinhHeThong"/> entity to edit with this form.
		/// </summary>
		/// <value>The <see cref="Entities.CauHinhHeThong"/> instance.</value>
		public Entities.CauHinhHeThong CauHinhHeThong
		{
			get {return this._CauHinhHeThong;}
			set
			{
				this._CauHinhHeThong = value;
				if (value != null) 
				{
					this.uxBindingSource.DataSource = value;
					BindControls();
				}			
				
			}
		}
		#endregion
		
		/// <summary>
		/// Binds the controls.
		/// </summary>
		private void BindControls()
		{
			this.uxIDCauHinhHeThong.DataBindings.Clear();
			this.uxIDCauHinhHeThong.DataBindings.Add("Text", this.uxBindingSource, "IDCauHinhHeThong", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxTen.DataBindings.Clear();
			this.uxTen.DataBindings.Add("Text", this.uxBindingSource, "Ten", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxGiaTri.DataBindings.Clear();
			this.uxGiaTri.DataBindings.Add("Text", this.uxBindingSource, "GiaTri", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxMoTa.DataBindings.Clear();
			this.uxMoTa.DataBindings.Add("Text", this.uxBindingSource, "MoTa", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
		}					
		
		#region Constructor
		
		/// <summary>
		/// Initializes a new instance of the <see cref="CauHinhHeThongEditControlBase"/> class.
		/// </summary>
		public CauHinhHeThongEditControlBase()
		{
			InitializeComponent();			
			
			this.uxBindingSource.CurrentItemChanged += new System.EventHandler(uxBindingSource_currentItemChanged);
		}		
		
		/// <summary>
		/// 
		/// </summary>
		private void uxBindingSource_currentItemChanged(object sender, System.EventArgs e)
		{
			if (_CauHinhHeThong != null) _CauHinhHeThong.Validate();
		}	
				
		/// <summary>
		/// Initializes the component.
		/// </summary>
		public void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.uxErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxBindingSource = new System.Windows.Forms.BindingSource(this.components);
			
			//this.uxTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
			this.uxIDCauHinhHeThong = new System.Windows.Forms.TextBox();
			uxIDCauHinhHeThongLabel = new System.Windows.Forms.Label();
			this.uxTen = new System.Windows.Forms.TextBox();
			uxTenLabel = new System.Windows.Forms.Label();
			this.uxGiaTri = new System.Windows.Forms.TextBox();
			uxGiaTriLabel = new System.Windows.Forms.Label();
			this.uxMoTa = new System.Windows.Forms.TextBox();
			uxMoTaLabel = new System.Windows.Forms.Label();
			
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).BeginInit();
			this.SuspendLayout();
			
			// 
			// uxTableLayoutPanel
			// 
			//this.uxTableLayoutPanel.AutoSize = true;
			//this.uxTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
			//this.uxTableLayoutPanel.ColumnCount = 2;
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 250F));
			//this.uxTableLayoutPanel.Location = new System.Drawing.System.Drawing.Point(3, 3);
			//this.uxTableLayoutPanel.Name = "uxTableLayoutPanel";
			//this.uxTableLayoutPanel.RowCount = 2;
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.Size = new System.Drawing.Size(450, 50);
			//this.uxTableLayoutPanel.TabIndex = 0;
			
			//
			// uxErrorProvider
			//
			this.uxErrorProvider.ContainerControl = this;
			this.uxErrorProvider.DataSource = this.uxBindingSource;
			
			//
			// uxIDCauHinhHeThongLabel
			//
			this.uxIDCauHinhHeThongLabel.Text = "IDCauHinhHeThong:";
			this.uxIDCauHinhHeThongLabel.Location = new System.Drawing.Point(3, 0);
			this.Controls.Add(this.uxIDCauHinhHeThongLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDCauHinhHeThongLabel);			
			//
			// uxIDCauHinhHeThong
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDCauHinhHeThong);
			this.uxIDCauHinhHeThong.Location = new System.Drawing.Point(160, 0);
			this.Controls.Add(this.uxIDCauHinhHeThong);
			//
			// uxTenLabel
			//
			this.uxTenLabel.Text = "Ten:";
			this.uxTenLabel.Location = new System.Drawing.Point(3, 26);
			this.Controls.Add(this.uxTenLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxTenLabel);			
			//
			// uxTen
			//
			this.uxTen.Width = 250;
			this.uxTen.MaxLength = 200;
			//this.uxTableLayoutPanel.Controls.Add(this.uxTen);
			this.uxTen.Location = new System.Drawing.Point(160, 26);
			this.Controls.Add(this.uxTen);
			//
			// uxGiaTriLabel
			//
			this.uxGiaTriLabel.Text = "GiaTri:";
			this.uxGiaTriLabel.Location = new System.Drawing.Point(3, 52);
			this.Controls.Add(this.uxGiaTriLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxGiaTriLabel);			
			//
			// uxGiaTri
			//
			this.uxGiaTri.Width = 250;
			this.uxGiaTri.MaxLength = 16;
			//this.uxTableLayoutPanel.Controls.Add(this.uxGiaTri);
			this.uxGiaTri.Location = new System.Drawing.Point(160, 52);
			this.Controls.Add(this.uxGiaTri);
			//
			// uxMoTaLabel
			//
			this.uxMoTaLabel.Text = "MoTa:";
			this.uxMoTaLabel.Location = new System.Drawing.Point(3, 78);
			this.Controls.Add(this.uxMoTaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxMoTaLabel);			
			//
			// uxMoTa
			//
			this.uxMoTa.Width = 250;
			this.uxMoTa.MaxLength = 16;
			//this.uxTableLayoutPanel.Controls.Add(this.uxMoTa);
			this.uxMoTa.Location = new System.Drawing.Point(160, 78);
			this.Controls.Add(this.uxMoTa);
			// 
			// CauHinhHeThongEditControlBase
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			//this.Controls.Add(this.uxTableLayoutPanel);
			this.AutoScroll = true;
			this.Name = "CauHinhHeThongEditControlBase";
			this.Size = new System.Drawing.Size(478, 311);
			//this.Localizable = true;
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).EndInit();			
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		#endregion
				
		#region ComboBox List
		
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	}
}
